<div id="contact-card" class="panel panel-default" data-ui-view="contactdetail">
    <div class="panel-heading">
        <span class="panel-title">
            <span ng-init="showTitleName=true" ng-show="showTitleName" ng-dblclick="showTitleName=false;getTittleFocus()">{{presentContactInfo.baseInfo.name}}</span>
            <input type="text" ng-change="dirtySet(0)" ng-show="!showTitleName" ng-blur="showTitleName=true" id="showTitleName" ng-model="presentContactInfo.baseInfo.name" required>
        </span>
        <i class="fa fa-home" style="display: inline" ng-show="disPersonalMessage(0)"></i>
        <i class="fa fa-male" style="color: blue;display: inline" ng-show="disPersonalMessage(1)"></i>
        <i class="fa fa-female" style="color: deeppink;display: inline" ng-show="disPersonalMessage(2)"></i>
    </div>
    <div class="panel-body">
        <div id="card" class="row">
            <div class="col-md-9" style="height:400px;overflow:auto">
                <div style="text-align:center">
                    <button ng-show="dirty[0]" ng-click="saveInfo()" class="btn btn-success">保存</button>
                    <!--<button ng-click="display(1)" class="btn btn-success">显示更多信息</button>-->
                    <button ng-show="dirty[0]" ng-click="refresh(1)" class="btn btn-success">重置</button>
                </div>
                <table class="table table-hover" style="margin-bottom: 0">
                    <tbody>
                    <tr>
                        <td style="width: 20%"><i style="width: 20%" class="fa fa-envelope"></i> E-Mail</td>
                        <td style="width: 100%;height:35px;display: block;float: left" id="contactDetail2Message" ondblclick="showOrInput(2,0)">{{presentContactInfo.baseInfo.emailList[0].value}}</td>
                        <td style="width: 100%;display: none" id="contactDetail2Inputtd">
                            <input type="text" ng-change="dirtySet(0)" class="form-control" id="contactDetail2Input" onblur="showOrInput(2,1)" ng-model="presentContactInfo.baseInfo.emailList[0].value"/>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 20%"><i style="width: 20%" class="fa fa-phone"></i> 电话</td>
                        <td style="width: 100%;height:35px;display: block;float: left" id="contactDetail3Message" ondblclick="showOrInput(3,0)">{{presentContactInfo.baseInfo.mobileNumberList[0].value}}</td>
                        <td style="width: 100%;display: none" id="contactDetail3Inputtd">
                            <input type="text" ng-change="dirtySet(0)" class="form-control" id="contactDetail3Input" onblur="showOrInput(3,1)" ng-model="presentContactInfo.baseInfo.mobileNumberList[0].value"/>
                        </td>
                    </tr>
                    <tr ng-repeat="item in infoDateStruct.basicInfo">
                        <td style="width: 20%"><i style="width: 20%" ng-class="ngGetBaseInfoImage(0,$index)"></i>{{item.name}}</td>
                        <td style="width: 80%" ng-show="ngShowOrInput(0,$index,2)" style="float: left" ng-dblclick="changeDate(0,0,-1,item.key,0);ngShowOrInput(0,$index,0)">{{presentContactInfo.baseInfo[item.key]}}</td>
                        <td style="width: 80%" ng-show="ngShowOrInput(0,$index,3)">
                            <input ng-change="dirtySet(0)" ng-if="item.option==1"  type="text" ng-change="dirtySet(0)" ng-class="getClassName(0,$parent.$index)" class="form-control" ng-blur="ngShowOrInput(0,$index,1)" ng-model="presentContactInfo.baseInfo[item.key]"/>
                            <select ng-change="dirtySet(0)" ng-if="item.option==2"  ng-model="presentContactInfo.baseInfo[item.key]" ng-options="opt for opt in item.select"></select>
                            <input ng-change="dirtySet(0)" type="date" ng-if="item.option==3" ng-model="$parent.$parent.$parent.$parent.tempDate" >
                            <span ng-repeat="radioItem in item.radio"><input ng-change="dirtySet(0)" type="radio" ng-if="item.option==4" name="{{item.key}}" value="{{radioItem.value}}" ng-model="presentContactInfo.baseInfo[item.key]">{{radioItem.name}}</span>
                            <a type="button" ng-if="item.option==2||item.option==4" ng-click="ngShowOrInput(0,$parent.$index,1)"><i class="fa fa-check"></i></a>
                            <a type="button" ng-if="item.option==3" ng-click="changeDate(0,0,-1,item.key,1);ngShowOrInput(0,$parent.$index,1)"><i class="fa fa-check"></i></a>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 20%"><i style="width: 20%" class="fa fa-tag"></i>标签</td>
                        <td style="width: 100%;height:35px;display: inline;float: left" id="contactDetail4Message" ondblclick="showOrInput(4,0)">{{presentContactInfo.tag}}</td>
                        <td style="width: 100%;display: none" id="contactDetail4Inputtd">
                            <input type="text" ng-change="dirtySet(0)" class="form-control" id="contactDetail4Input" onblur="showOrInput(4,1)" ng-model="presentContactInfo.tag"/>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 20%"><i style="width: 20%" class="fa fa-bars"></i>公司</td>
                        <td style="width: 100%;height:35px;display: inline;float: left" id="contactDetail5Message" ondblclick="showOrInput(5,0)">{{presentContactInfo.userCompanyName}}</td>
                        <td style="width: 100%;display: none" id="contactDetail5Inputtd">
                            <input type="text" ng-change="dirtySet(0)" class="form-control" id="contactDetail5Input" onblur="showOrInput(5,1)" ng-model="presentContactInfo.userCompanyName"/>
                        </td>
                    </tr>
                    </tbody>
                </table>
                <table class="table table-hover">
                    <tbody id="contact_detail" ><!--ng-show="detailContact">-->
                    <tr ng-repeat="item in infoDateStruct.baseInfo" ng-if="item.option!=0">
                        <td style="width: 20%"><i style="width: 20%" ng-class="ngGetBaseInfoImage(1,$index)"></i>{{item.name}}</td>
                        <td style="width: 80%" ng-show="ngShowOrInput(1,$index,2)" style="float: left" ng-dblclick="changeDate(0,1,-1,item.key,0);ngShowOrInput(1,$index,0)">
                            <span ng-if="item.option!=4">{{presentContactInfo.baseInfo[item.key]}}</span>
                            <span ng-if="item.option==4">{{getRadioName(1,-1,$index,item.key)}}</span>
                        </td>
                        <td style="width: 80%" ng-show="ngShowOrInput(1,$index,3)">
                            <span ng-if="item.option==5" ng-class="getClassName(1,$parent.$index)" ng-dblclick="ngShowOrInput(1,$index,1)">{{presentContactInfo.baseInfo[item.key]}}<span style="color: red">(只读)</span></span>
                            <input type="text" ng-change="dirtySet(0)"  ng-if="item.option==1" ng-class="getClassName(1,$parent.$index)" class="form-control" ng-blur="ngShowOrInput(1,$index,1)" ng-model="presentContactInfo.baseInfo[item.key]"/>
                            <select ng-if="item.option==2"  ng-model="presentContactInfo.baseInfo[item.key]" ng-options="opt for opt in item.select"></select>
                            <input type="date" ng-if="item.option==3"  ng-model="$parent.$parent.$parent.$parent.tempDate" >
                            <span ng-repeat="radioItem in item.radio"><input  type="radio" ng-if="item.option==4" name="{{item.key}}" value="{{radioItem.value}}" ng-model="presentContactInfo.baseInfo[item.key]">{{radioItem.name}}</span>
                            <a type="button" ng-if="item.option==2||item.option==4" ng-click="ngShowOrInput(1,$parent.$index,1)"><i class="fa fa-check"></i></a>
                            <a type="button" ng-if="item.option==3" ng-click="changeDate(0,1,-1,item.key,1);ngShowOrInput(1,$parent.$index,1)"><i class="fa fa-check"></i></a>
                        </td>
                    </tr>
                    </tbody>
                </table>
                <div style="text-align:center">
                    <button ng-show="dirty[0]" ng-click="saveInfo()" class="btn btn-success">保存</button>
                    <!--<button ng-click="display(2)" class="btn btn-success">隐藏多余信息</button>-->
                    <button ng-show="dirty[0]" ng-click="refresh(1)" class="btn btn-success">重置</button>
                </div>
            </div>
            <div class="col-md-3 headshot">
                <img ng-src="{{presentContactInfo.baseInfo.photoUrl!=undefined&&presentContactInfo.baseInfo.photoUrl!=''?presentContactInfo.baseInfo.photoUrl:'assets/img/addressbook/1.jpg'}}" alt="" style="width: 100%">
                <form name="form" style="margin-top: 10px;margin-bottom: 10px">
                    <input type="file" ngf-select ng-model="file.photo" ng-show="file.photo==undefined" name="file" ngf-pattern="'image/*'" ngf-accept="'image/*'" ngf-max-size="1MB" ngf-min-height="40" ></a>
                    <input class="btn btn-success" ng-hide="file.photo==undefined" type="button" ng-click="submit()" value="上传">
                    <input class="btn btn-success" ng-hide="file.photo==undefined" type="button" ng-click="file.photo=undefined" value="重新选择">
                </form>
                <a class="text-center" ui-sref="contactmore"><button class="btn btn-success">查看{{presentContactInfo.baseInfo.name}}的更多信息</button></a>
            </div>
        </div>
    </div>
</div>
